<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <title>hello react</title>
    <style></style>
  </head>
  <body>
    <div id="test"></div>
    <div id="test2"></div>
    <div id="test3"></div>
    <!-- 引入react核心库 -->
    <script src="../js/react.development.js"></script>
    <!-- 引入react Dom库 用于支持 react操作dom-->
    <script src="../js/react-dom.development.js"></script>
    <!-- 引入babel 用于将 jsx 转为 js -->
    <script src="../js/babel.min.js"></script>

    <!-- 使用babel 转译jsx -->
    <script type="text/babel">
      function Person(props) {
        const { name, age, sex } = props;
        return (
          <ul>
            <li>姓名：{name}</li>
            <li>性别：{age}</li>
            <li>年龄：{sex}</li>
          </ul>
        );
      }
      const p = {
        name: "xjq",
        age: 18,
        sex: "男",
      };
      ReactDOM.render(<Person {...p} />, document.getElementById("test"));
    </script>
  </body>
</html>
